<script type="text/javascript">
/*function displaySave(id, status){
	var value = $('select[id="status'+id+'"] option:selected').val();
	if(value == status){
		$('#save'+id).css('display','none');
	}else{
		$('#save'+id).css('display','block');
	}
}*/
function changeStatus(id,user_id){
	$('#wait').css('display','block');
	var status = $('select[id="status'+id+'"] option:selected').val();
	//alert(status);
	var query = '';
	$.post('?sMod=transaction_index&sAction=do_edit&status='+status+'&id='+id+'&user_id='+user_id,query,function(data){
			$('#wait').css('display','none');
			$('#display_value'+id).html($('select[id="status'+id+'"] option:selected').text());
			$('#display'+id).css('display','block');
			$("#select"+id).css('display','none');
			$('#date_time'+id).html(data);
	},"html");
}
function changeDisplay(id){
	$("#display"+id).click(function(){
		//alert(id);
	$("#select"+id).css('display','block');
	$("#display"+id).css('display','none');
	});
}
function cancelStatus(id){
		$("#select"+id).css('display','none');
		$("#display"+id).css('display','block');
};
</script>
<div class="top_list_page"></div>
<table class="adminlist">
  <tr>
    <th scope="col">&nbsp;</th>
    <th scope="col">{PACKET.name}</th>
    <th scope="col">{TRANSACTIONS.fullname}</th>
    <th scope="col" width="50px">{TRANSACTIONS.download_items}</th>
    <th scope="col">{TRANSACTIONS.period}</th>
    <th scope="col">{TRANSACTIONS.price}</th>
    <th scope="col">{TRANSACTIONS.status}</th>
    <th scope="col">{TRANSACTIONS.activity}</th>
    <!--      
    <th scope="col" width="50px">{FORM.edit}</th>
    <th scope="col" width="50px">{FORM.delete}</th>
  --></tr>
    <form   id ="frmUpdateCate" action="?sMod=category_index&sAction=update_status"  method="post" enctype="multipart/form-data">     
    
  <input type="hidden" name="sAction" value="update_status" /> 
  <!-- BEGIN: rowPacket -->
  <tr class="{rowCategory.css}">
  	<td>{row.no}</td>
    <td>{row.name}</td>
    <td>{row.admin_fullname}</td>
    <td>{row.download_items}</td>
    <td>{row.periods}</td>
    <td>{row.price}</td>
    <td width="160">
    	<div id="display{row.trans_id}" style="display: block; float: left;">
    		<a id="display_value{row.trans_id}" href="#" onclick="return changeDisplay('{row.trans_id}');">{row.status_value}</a>
    	</div>
    	<div id="select{row.trans_id}" style="display: none; float: left;">
    		<div style="float: left;">
		    	<select name="status{row.trans_id}" id="status{row.trans_id}" onchange="return displaySave('{row.trans_id}','{row.status}');">
		    		{row.select_option}
		    	</select>
		    </div>
	    	<div style="float: left;">
		    	<div style="float: left;padding: 0 0 0 10px;"><img id="save{row.trans_id}" onclick="return changeStatus('{row.trans_id}','{row.user_id}');" style="cursor: pointer;" src="{URL_TEMPLATE_ADMIN}image/tick.png"></div>&nbsp;&nbsp;&nbsp;
		    	<div style="float: left;padding: 0 0 0 10px;"><img onclick="return cancelStatus('{row.trans_id}');" src="{URL_TEMPLATE_ADMIN}image/publish_x.png" style="cursor: pointer;"></div>
	    		<span id="wait" style="display: none;float: right">updating...</span>
	    	</div>
    	</div>
    </td>
    <td width="200">
    	<div id="date_time{row.trans_id}">{row.activity}</div>
    </td>
    <!--<td>
        <a href="?sMod=packet_index&sAction=edit_form&id={row.id}">
        <img src="{URL_TEMPLATE_ADMIN}image/icon/edit.gif" title="{FORM.edit}" alt="{FORM.edit}" border="0" /></a></td>
    <td><a onclick="return confirmDelete();" href="?sMod=packet_index&sAction=do_delete&id={row.id}"><img src="{URL_TEMPLATE_ADMIN}image/icon/del.gif" title="{FORM.delete}" alt="{FORM.delete}" border="0" /></a></td>
  --></tr>
  <!-- END: rowPacket -->
  
  </form>
  <tr>
    <td colspan="7">{navigator}</td>
  </tr>
</table>

